package avicit.bdp.dms.das.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2020-06-24 14:53
 * @类说明：bdp_das_category
 * @修改记录：
 */
@ApiModel(value = "BdpDasCategoryDTO", description = "bdp_das_category")
@Table(name = "bdp_das_category")
public class BdpDasTreeDTO extends BaseDTO {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Transient
    private String id;

    /**
     * name
     */
    @Transient
    private String name;

    public List<BdpDasTreeDTO> getChildren() {
        return children;
    }

    public void setChildren(List<BdpDasTreeDTO> children) {
        this.children = children;
    }

    /**
     * 是否为表的标识  （0-否  1-是）
     */
    @Transient
    private Integer tableFlag;

    /**
     * 子对象集合
     */
    @Transient
    private List<BdpDasTreeDTO> children;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getTableFlag() {
        return tableFlag;
    }

    public void setTableFlag(Integer tableFlag) {
        this.tableFlag = tableFlag;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "bdp_das_category";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "bdp_das_category";
        } else {
            return super.logTitle;
        }
    }

    @Override
    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
